package com.sloera.myview;

import android.os.Bundle;
import android.widget.FrameLayout;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        FrameLayout frameLayout = findViewById(R.id.mylayout);
        final RabbitView rabbitView = new RabbitView(this);
        rabbitView.setOnTouchListener((v, e) -> {
            rabbitView.bitmapX = e.getX();
            rabbitView.bitmapY = e.getY();
            rabbitView.invalidate();
            return true;
        });
        frameLayout.addView(rabbitView);
    }
}
